package com.mdlib.helper.ui.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ljlib.help.R;
import com.mdlib.helper.model.entity.SendMainServiceEntity;

import java.util.List;

/**
 * 作者：HQY on 16/12/7 11:06
 * 邮箱：hqy_xz@126.com
 */

public class SendHomeMainServiceAdapter extends BaseQuickAdapter<SendMainServiceEntity> {

    public SendHomeMainServiceAdapter(List<SendMainServiceEntity> data) {
        super(R.layout.item_send_main_service, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, SendMainServiceEntity mainServiceEntity) {
        baseViewHolder.setText(R.id.tv_main_service, mainServiceEntity.getName());
        Glide.with(mContext)
                .load("http://www."+mainServiceEntity.getPath())
                .placeholder(R.drawable.iv_details_minnetonka)
                .error(R.drawable.iv_details_minnetonka)
                .into((ImageView) baseViewHolder.getView(R.id.iv_main_service));

    }
}
